console.log(process.env.RUN_MODE === "single");
// const webpack = require("webpack");

module.exports = {
  transpileDependencies: ["vuetify"],

  publicPath: process.env.NODE_ENV === "production" ? "./" : "",

  chainWebpack: config => {
    config.plugin("define").tap(definitions => {
      Object.assign(definitions[0]["process.env"], {
        RUN_MODE: JSON.stringify(process.env.RUN_MODE)
      });
      return definitions;
    });

    if (process.env.NODE_ENV === "production") {
      config.optimization.minimizer("terser").tap(args => {
        args[0].terserOptions.compress.warnings = false;
        args[0].terserOptions.compress.drop_console = true;
        // args[0].terserOptions.compress.drop_debugger = true // 默认true
        args[0].terserOptions.compress.pure_funcs = ["console.*"];
        return args;
      });
    }
  },

  // configureWebpack: {
  //   plugins: (() => {
  //     console.log("Here!");
  //     return [
  //       new webpack.DefinePlugin({
  //         "process.env": { RUN_MODE: JSON.stringify(process.env.RUN_MODE) }
  //       })
  //     ];
  //   })()
  // },

  pluginOptions: {
    i18n: {
      locale: undefined,
      fallbackLocale: undefined,
      localeDir: undefined,
      enableInSFC: undefined
    }
  }
};
